<?php
class Model_Admin_Album extends Model{

    public function uploadImage($id,$filepath,$filename){
            
        $upFilePath='temp/Album/Album'.$id."-M-".$filename;

        $model=new Model_Admin_Common();

        $result=$model->upload_file($filepath,$upFilePath,'');

        if($result){

            $total_rows=DB::update('album')->set(array('image'=>$filename))

            ->where('albumid','=',$id)->execute();

             Database::instance()->commit();

            return true;
        }
    }

}